package com.itsu.spbspider.util;

import org.apache.commons.lang3.StringUtils;

import java.util.Base64;

public class EncryptUtil {

    public static String encrypt(String source) {
        if (StringUtils.isBlank(source))
            return null;
        return Base64.getEncoder().encodeToString(source.getBytes());
    }

    public static String decode(String source) {
        if (StringUtils.isBlank(source))
            return null;
        return new String(Base64.getDecoder().decode(source));
    }
}
